/*
 * GUI.h
 *
 * Author: Samuel Queiroz
 */

#ifndef GUI_H_
#define GUI_H_

#include "../Thread/Threadable.h"

#include "../Component/Button.h"
#include "../Component/Slider.h"
#include "../Component/Switcher.h"

class GUI
	: public Threadable
{

private:

	AnalogButton *leftAButton;
	AnalogButton *rightAButton;

	SimpleButton *upButton;
	SimpleButton *downButton;
	SimpleButton *leftButton;
	SimpleButton *rightButton;

	Switcher *robotSwitcher;
	Switcher *controlSwitcher;

	Slider *speedSlider;
	Slider *rotationSlider;

	void run();

	int getPosition(Slider *slider, int nUnits);

public:

	GUI(
		SimpleButton *upButton,
		SimpleButton *downButton,
		SimpleButton *leftButton,
		SimpleButton *rightButton,
		AnalogButton *leftAButton,
		AnalogButton *rightAButton,
		Switcher *robotSwitcher,
		Switcher *controlSwitcher,
		Slider *speedSlider,
		Slider *rotationSlider)
	{
		this->leftAButton = leftAButton;
		this->rightAButton = rightAButton;

		this->upButton = upButton;
		this->downButton = downButton;
		this->leftButton = leftButton;
		this->rightButton = rightButton;

		this->robotSwitcher = robotSwitcher;
		this->controlSwitcher = controlSwitcher;

		this->speedSlider = speedSlider;
		this->rotationSlider = rotationSlider;
	}

};

#endif
